//
//  BCWebImageManager.h
//  BCWebImageKit
//
//  Created by Basic on 2019/9/3.
//  网络图片组件 管理类
//  暂时调用SDWebImage,后续内部可以切换实现

#import <Foundation/Foundation.h>
#import "BCWebImageKitPublic.h"

NS_ASSUME_NONNULL_BEGIN

@interface BCWebImageManager : NSObject

//MARK: - 下载图片
/**
 根据URL下载图片

 @param urlStr url 字符串
 @param completedBlock completedBlock description
 @return return value description
 */
+ (id<BCWebImageOperation> )loadImageWithURLStr:(nullable NSString *)urlStr withCompletion:(void(^_Nullable)(UIImage * _Nullable image, NSData * _Nullable data, BOOL finished) )completedBlock;

/**
 根据URL下载图片

 @param url url description
 @param options options description
 @param progressBlock progressBlock description
 @param completedBlock completedBlock description
 @return return value description
 */
+ (id<BCWebImageOperation> )loadImageWithURL:(nullable NSURL *)url options:(BCWebImageOptions)options progress:(void(^_Nullable)(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) )progressBlock completed:(void(^_Nullable)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BCImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) )completedBlock;


//MARK: - 取消下载
/**
 取消下载
 */
+ (void)cancelAll;

//MARK: - 缓存
/**
 获取缓存大小

 @return 返回单位字节
 */
+ (NSUInteger )getSize;
/**
 清除内存缓存
 */
+ (void)clearMemory;
/**
 清除文件缓存

 @param completion 完成回调
 */
+ (void)clearDisk:(void(^_Nullable)(void) )completion;
@end

NS_ASSUME_NONNULL_END
